﻿using System.Xml.Linq;

namespace Phoenix.Xna.Framework.Serialization.Markup
{
    /// <summary>
    /// Defines the interface for basic serializable elements.
    /// </summary>
    internal interface IMarkupElement
    {
        /// <summary>
        /// Gets or sets the SerializationService that provides context to references, etc.
        /// </summary>
        Serializer Serializer { get; set; }

        /// <summary>
        /// Serialize the element to XML.
        /// </summary>
        /// <returns>The element markup serialzed as an XElement.</returns>
        XElement Serialize();

        /// <summary>
        /// Deserialzie the element from an XElement.
        /// </summary>
        /// <param name="xml">The XElement to deserialize this element from.</param>
        void Deserialize(XElement xml);
    }
}
